<extend name="Layout::news"/>

<block name="content">
    <div class="layout-content">
        <div class="mt15 pr15">
            <form action="{:U(index)}" method="get" class=" form-inline form-search mt15">
                <div class="form-group">
                    <label>关键字搜索</label>
                    <input type="text" placeholder="输入标签" class="form-control input-sm" name="name"
                           value="<?php echo $_SESSION['like']['newscate']; ?>"/>
                    <button type="submit" class="btn btn-success btn-sm">
                        <span class="glyphicon glyphicon-search"></span> 搜索
                    </button>
                </div>

                <a href="{:U('Newscate/create')}" class="btn btn-sm btn-success pull-right">添加分类</a>
            </form>

        </div>


        <div class="clearfix"></div>


        <!--content-main start-->
        <div class="container-fluid content-main">
            <div class="row">
                <div class="col-md-12">
                    </form>
                    <table class="table table-hover mt15">
                        <thead>
                        <tr>
                            <th width="20%">PID</th>
                            <th width="20%">分类名</th>
                            <th width="20%">创建日期</th>
                            <th width="40%">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <notempty name="list">
                            <foreach name="list" item="val">
                                <tr class="pages">
                                    <td>
                                        {$val.pid}
                                    </td>
                                    <td>
                                        {$val.name}
                                    </td>
                                    <td>
                                        {$val.create}
                                    </td>
                                    <td>
                                        <a href="{:U('create',['id'=>$val['id']])}">添加子分类</a>|
                                        <a href="{:U('index',['pid'=>$val['pid']])}">查看父类</a>|
                                        <a href="{:U('index',['id'=>$val['id']])}">查看子分类</a>|
                                        <a href="{:U('update',['id'=>$val['id']])}">修改</a>|
                                        <a href="{:U('del',['id'=>$val['id']])}">删除</a>
                                    </td>
                                </tr>
                            </foreach>

                            <else/>
                            <tr>
                                <td colspan="4" align="center">
                                    没有公告
                                </td>
                            </tr>
                        </notempty>
                        </tbody>
                    </table>

                    <div class="pull-right">
                                 <span class="pagination">
                                        {$page}
                                 </span>
                    </div>
                    <div class="clearfix"></div>
                </div>
            </div>

        </div>
        <!--content-main end-->

    </div>


</block>